﻿{include file="public/header" /}
<style>
	.am-dropdown{
		width: 100%;
		margin-left: 30px;
		margin-bottom: 10px;
	}
	.am-dropdown div{
		color: #000;
	}
</style>
<form method="post" class="form-x" action="{if $data.id}?id={$data.id}{/if}">
	<div class="panel admin-panel" style="background: #fff; overflow: hidden">
		<br>
		<script>
            var pid='{$data.pid}';
            var cid='{$data.cid}';
            var aid='{$data.aid}';
            var selectc=true;
            var selecta=true;
		</script>
		<div class="am-dropdown">
			<div class="label">
				<label>{:lang('currency')['city']}</label>
			</div>
			<div class="field">
				{include file="public/city" /}
			</div>
		</div>
		<div class="am-dropdown">
			<div class="label">
				<label>类型</label>
			</div>
			<div class="field">
				<select name="type" class="input input-auto" onchange="change(this.value)">
					<option value="1" {if $data.type == 1}selected{/if}>启动图</option>
					<option value="2" {if $data.type == 2}selected{/if}>活动展示图</option>
				</select>
			</div>
		</div>
		<div class="am-dropdown">
			<div class="label">
				<label for="title">{:lang('label')['title']}</label>
			</div>
			<div class="field">
				<input type="text" class="input input-auto" id="title" name="title" value="{$data.title}" size="80" placeholder="{:lang('label')['title']}" data-validate="required:{:lang('currency')['required']}" />
			</div>
		</div>
		<div class="am-dropdown">
			<div class="label">
				<label for="url">{:lang('label')['url']}</label>
			</div>
			<div class="field">
				<input type="text" class="input input-auto" id="url" name="url" value="{$data.url}" size="80" placeholder="{:lang('label')['url']}" data-validate="required:{:lang('currency')['required']}" />
			</div>
		</div>
		<div class="am-dropdown">
		<div class="input-inline clearfix">
			<div class="label">
				<label for="image">{:lang('label')['image']}</label>
			</div>
			<div class="field">
				<input type="text" readonly class="input input-auto" id="image" name="image" value="{$data.image}" size="65" placeholder="{:lang('label')['image']}" data-validate="required:{:lang('currency')['required']}" />
				<span class="addbtn"><button type="button" data-id="image" class="button upload">{:lang('form')['file']}</button></span>
			</div>
		</div>
		</div>
		<div class="am-dropdown" id="time_div" {if $data.type == 2}style="display:none"{/if}>
			<div class="label">
				<label for="url">显示时间</label>
			</div>
			<div class="field">
				<input type="number" class="input input-auto" id="time" name="time" value="{$data.time}" size="10" placeholder="显示时间" data-validate="required:{:lang('currency')['required']}" /> 秒
			</div>
		</div>
		<div class="am-dropdown">
			<div class="label">
				<label>{:lang('label')['status']}</label>
			</div>
			<div class="field">
				<div class="button-group button-group-small radio">
					<label class="button {if $data.status == "1" || !$data.status}active{/if}">
						<input name="status" value="1" {if $data.status == "1" || !$data.status}checked="checked"{/if} type="radio"><span class="icon icon-check"></span> {:lang('currency')['status_1']}</label>
					<label class="button {if $data.status == "2"}active{/if}">
						<input name="status" value="2" {if $data.status == "2"}checked="checked"{/if} type="radio"><span class="icon icon-times"></span> {:lang('currency')['status_2']}</label>
				</div>
			</div>
		</div>
		<div class="am-dropdown">
			<div class="label">
				<label>{:lang('label')['remark']}</label>
			</div>
			<div class="field">
				<textarea name="remark" class="input input-auto" rows="5" cols="80" placeholder="{:lang('label')['remark']}" data-validate="required:{:lang('currency')['required']}">{$data.remark}</textarea>
			</div>
		</div>
		<div class="form-button">
			<button class="button bg-main" type="submit">{:lang('form')['submit']}</button>
		</div>
		<br/>
	</div>
</form>
<script>
	var time_ = '{$data.time}';
	function change(val) {
		if(val == 2){
		    $("#time").val(0);
		    $("#time_div").css('display','none');
		}else{
            $("#time").val(time_);
		    $("#time_div").css('display','');
		}
    }
</script>
{include file="public/footer" /}